﻿@model PagedList.IPagedList<tutors_clus.Models.annoucement>

@{
    ViewBag.Title = "Thông báo";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
    <div class="Breadcrumb">
        <ul>
            <li><a class="home" href="#"></a></li>
            <li>Thông báo</li>
        </ul>
    </div>

    @{Html.RenderAction("Search_Annou", "Home");}

    <div class ="content">
           
               @foreach (var item in Model)
               {
                   <div class="news">
                       <div class="title_news">@Html.ActionLink(@item.title_ann, "Annoucement", new { id = item.id_ann}) <i>(@Html.DisplayFor(m => item.create_date_ann))</i></div>
                       <div class="detail_news"> @{if (item.detail_ann.Length < 200) { @MvcHtmlString.Create(item.detail_ann); } else { @MvcHtmlString.Create(item.detail_ann.Substring(0, 200)); }}...</div>
                       <div class="readmore">@Html.ActionLink("xem tiếp", "Annoucement", new { id = item.id_ann})</div>                      
                       <div class="line"></div>
                   </div>
                   
               } 

        <div>
        Trang @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) trong tổng số @Model.PageCount trang

        @if (Model.HasPreviousPage)
        {
            @Html.ActionLink("<<", "Annoucements", new { page = 1, order = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
            @Html.Raw(" ");
            @Html.ActionLink("< Trước", "Annoucements", new { page = Model.PageNumber - 1,  order = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
        }
        else
        {
            @:<<
            @Html.Raw(" ");
            @:< Trước
        }
        @if (Model.HasNextPage)
        {
            @Html.ActionLink("Sau >", "Annoucements", new { page = Model.PageNumber + 1,  order = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
            @Html.Raw(" ");
            @Html.ActionLink(">>", "Annoucements", new { page = Model.PageCount,  order = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
        }
        else
        {
            @:Sau >
            @Html.Raw(" ")
            @:>>
        }
        </div>
          
    </div>

